import axios from "axios";
import { getToken } from "@/utils/auth";
const baseURL = "https://supershop.tuomaimai.com";
const token = getToken();
// 解析二进制文件的下载
export function getCommonQRCode(params) {
  return axios({
    method: "get",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
      token: token
    },

    // responseType: "arraybuffer", //arraybuffer/blob//加上格式，二进制
    responseType: "blob", //arraybuffer/blob//加上格式，二进制
    url: baseURL + "/app/v1/createCommonQRCode",
    params
  });
}

export function getAllQRCode(params) {
  return axios({
    method: "get",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
      token: token
    },
    responseType: "blob", //arraybuffer/blob//加上格式，二进制
    url: baseURL + "/app/v1/downloadAll",
    params
  });
}
